package Problem;

import java.util.Scanner;


public class ISBN码 {
	
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		String[] arr = str.split("-");
		int total = 0;
		int[] num = new int[]{1};
		total = Integer.parseInt(arr[0]) * num[0];
		num[0]++;
		total += getTotal(arr[1],num);
		total += getTotal(arr[2],num);
		if (total % 11 == 10) {
			if(arr[3].equals("X")) {
				System.out.println("Right");
			}else {
				System.out.println(arr[0] + "-" + arr[1] + "-" + arr[2] + "-" + "X");
			}
		}else {
			if(total % 11 == Integer.parseInt(arr[3])) {
				System.out.println("Right");
			}else {
				System.out.println(arr[0] + "-" + arr[1] + "-" + arr[2] + "-" + total%11);
			}
		}
	}

	private static int getTotal(String string, int[] num) {
		// TODO Auto-generated method stub
		int total = 0;
		for (int i = 0; i < string.length(); i++) {
			total += Character.getNumericValue(string.charAt(i)) * num[0];
			num[0]++;
 		}
		return total;
	}


}
